<template>
  <div class="con">
    <div class="contbox6_10">
      <div class="titlelist6_10">活动管理 / {{title}}</div>
      <div class="content">
        <upload1 ref="one" />
        <upload2 ref="two" />
        <div class="btnWrap" style="margin-left: 40%">
          <el-button type="primary" @click="subData" :loading="loadingBool" v-if="list">完成</el-button>
          <el-button @click="result" v-if="list">取消</el-button>
          <el-button @click="results" v-if="lists">返回</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import upload1 from "./activeNext1";
import upload2 from "./activeNext2";
import https from '../../plugins/https';
export default {
  components: {
    upload1,
    upload2,
  },
  data() {
    return {
      list:'',
      loadingBool:false
    }
  },
  created(){
    if(this.$route.query.user=='1'||this.$route.query.user=='y'){
      this.list=false
      this.lists=true
    }else{
      this.list=true
      this.lists=false
    }
    if(this.$route.query.name=="createActive"){
      this.title="排名奖励"
    }else if(this.$route.query.name=="teamRewardfrind"){
      this.title="商户拉新"
    }else{
      this.title="伙伴拉新"
    }
  },
  methods: {
    quLoading(){
      this.$router.push({
        name:"activityManagement"
      })
      this.loadingBool = false
    },
    quLoading2(){
      this.loadingBool = false
    },

    subData() {
      this.loadingBool = true
      this.$refs.one.getData();
      this.$refs.two.submitVuex();
      this.$refs.two.submit();
    },
    result() {
      // this.$router.go(-1)
      if(this.$route.query.name=="teamRewardfrind"){// 商户拉新
        this.$router.push({name: this.$route.query.name,
          query:{
            activeUid:this.$route.query.activeUid,
            type:this.$route.query.type,
            dis:this.$route.query.user,
            uid:this.$route.query.uid,
          }
        });
      }else if(this.$route.query.name=="frindsestablish"){//伙伴拉新
        this.$router.push({name: this.$route.query.name,
          query:{
            activeUid:this.$route.query.uid,
            type:this.$route.query.type,
            user:this.$route.query.user,
            uid:this.$route.query.uid,
          }
        });
      }else{// 排名奖励
        this.$router.push({name: this.$route.query.name,
          query:{
            activeUid:this.$route.query.uid,
            type:this.$route.query.type,
            user:this.$route.query.user,
            uid:this.$route.query.uid,
          }
        });
      }
      
    },
    results(){
      this.$router.push({
        name: 'activityManagement',
      });
    }
  },
};
</script>

<style scoped>
.con {
  position: relative;
}
.contbox6_10 {
  width: 100%;
  /* margin-left: 2%; */
  /*  height: 87.5vh; */
  overflow-x: auto;
  box-sizing: border-box;
  float: left;
}
.content {
  min-width: calc(100% - 40px);
}
</style>